import Taro from '@tarojs/taro'
import React, { PureComponent } from 'react'
// 界面组件
import { View, Text, ScrollView, Image, Video, WebView } from '@tarojs/components'

import { AtIcon, AtSearchBar } from 'taro-ui'
import CTopbar from '@/components/CTopBar/index'
import GetTopBarInfo from '@/utils/GetTopBarInfo' //动态高度
import './index.scss'
import { CImage } from '@/components'
import logo from '@/assets/home_logo.png'
/**
 * 直播详情
 */

type I = {
  comment_value: string
}

interface LiveDetails {
  state: I
}

class LiveDetails extends PureComponent<any> {
  constructor(props) {
    super(props)
    this.state = {
      comment_value: '',
    }
    let videoContext = Taro.createVideoContext('video')
    console.log(videoContext)
    videoContext.playbackRate(2)
  }
  goto_live_details() {
    Taro.navigateTo({
      url: 'pages/Live/LiveDetails',
    })
  }
  onScrollToUpper() {}

  // or 使用箭头函数
  // onScrollToUpper = () => {}

  onScroll(e) {
    console.log(e.detail)
  }
  onSearchChange() {}

  render() {
    const scrollStyle = {
      height: '600rpx',
    }
    const scrollTop = 0
    const Threshold = 20
    const vStyle = {
      height: '40px',
      'background-color': 'rgb(26, 173, 25)',
      display: 'flex',
      alignItems: 'center',
      padding: '0 20rpx',
      fontSize: '24rpx',
    }
    const comment_list: string[] = []
    for (var i = 0; i < 100; i++) {
      comment_list.push(`我是第${i}条评论`)
    }

    return (
      <View style={{ paddingTop: `${GetTopBarInfo().TopBarHeight}px` }}>
        <View className='header'>
          <CTopbar title='直播详情页面' showBack></CTopbar>
        </View>
        <WebView src={'https://appl6b3uc9z9663.h5.xiaoeknow.com/'} />
      </View>
    )
  }
}

export default LiveDetails
